home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / network.zip / SOURCE.ZIP / GETNAME.ASM next >
Assembly Source File  |  1989-09-23  |  1KB  |  57 lines

  1.  
  2.                 .MODEL small
  3.  
  4. StdIn           =       0000
  5. StdOut          =       0001
  6. StdErr          =       0002
  7.  
  8.                 .DATA
  9. NameMsg         DB      13, 10
  10.                 DB      "Machine name: "
  11. MachineName     DB      16 Dup(' ')
  12.                 DB      13, 10
  13. NameMsgL        =       $-NameMsg
  14.  
  15. ErrorMsg        DB      13, 10
  16.                 DB      "No name, or GetName ended due to error."
  17.                 DB      13, 10
  18. ErrorMsgL       =       $-ErrorMsg
  19.  
  20.                 .STACK  200h
  21.  
  22. ; -------------------------------------------
  23.                 .CODE
  24.  
  25. Start:          Mov     AX, @Data
  26.                 Mov     DS, AX
  27.  
  28.                 Mov     AX, 5E00h
  29.                 Mov     DX, Offset MachineName
  30.                 Int     21h
  31.                 JC      DidntWork
  32.                 Cmp     CH, 0
  33.                 JE      DidntWork
  34.  
  35.                 Mov     DX, Offset NameMsg
  36.                 Mov     BX, StdOut
  37.                 Mov     CX, NameMsgL
  38.                 Mov     AX, 4000h
  39.                 Int     21h
  40.  
  41.                 Mov     AX, 4C00h
  42.                 Int     21h
  43.  
  44. DidntWork:      Mov     DX, Offset ErrorMsg
  45.                 Mov     BX, StdOut
  46.                 Mov     CX, ErrorMsgL
  47.                 Mov     AX, 4000h
  48.                 Int     21h
  49.  
  50.                 Mov     AX, 4C00h
  51.                 Int     21h
  52.  
  53.                 End     Start
  54.  
  55.  
  56.  
  57.